﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace IndoReputation.Models.BusinessObject
{
    public class News : CommonEntity
    {
        /// <summary>
        /// Default Contructor
        /// </summary>
        public News()
        { }

        [Required]
        public Int64 ID
        {
            set;
            get;
        }

        [Required]
        public int NewsCategory
        {
            set;
            get;
        }

        [Required(ErrorMessage = "Please type the Name")]
        [StringLength(256, ErrorMessage = "String may not be longer than 256 characters")]
        public string NewsCategoryName
        {
            set;
            get;
        }

        [Required]
        public int MediaID
        {
            set;
            get;
        }

        [Required(ErrorMessage = "Please type the Name")]
        [StringLength(256, ErrorMessage = "String may not be longer than 256 characters")]
        public string MediaName
        {
            set;
            get;
        }

        [Required]
        public System.DateTime DatePublished
        {
            set;
            get;
        }

        [Required(ErrorMessage = "Please type the Name")]
        [StringLength(256, ErrorMessage = "String may not be longer than 256 characters")]
        public string Title
        {
            set;
            get;
        }
        
        public string Sumary
        {
            set;
            get;
        }

        [DataType(DataType.MultilineText)]
        [StringLength(2048, ErrorMessage = "String may not be longer than 2048 characters")]
        public string Link
        {
            set;
            get;
        }
        public DateTime? CreateAt
        {
            set;
            get;
        }
        public int? CreateBy
        {
            set;
            get;
        }
        public DateTime? UpdateAt
        {
            set;
            get;
        }
        public int? UpdateBy
        {
            set;
            get;
        }
        public bool IsPublished { get; set; }
    }

    public class NewsJoin : CommonEntity
    {
        public int ID { get; set; }
        public int NewsCategory { get; set; }
        public string NewsCategoryName { get; set; }
        public int MediaID { get; set; }
        public string MediaName { get; set; }
        public DateTime DatePublished { get; set; }
        public string Title { get; set; }
        public string Link { get; set; }
        public DateTime CreateAt { get; set; }
        public bool IsPublished { get; set; }
        public float AvgMark { get; set; }
        public bool IsNewspaper { get; set; }
        public bool IsTV { get; set; }
        public bool IsRadio { get; set; }
        public bool IsOnlineNews { get; set; }
        public bool IsOnline { get; set; }
        public string FlagPath { get; set; }
    }

    public class ChartShort
    {
        public Int64 Totals { get; set; }
        public int AvgMark { get; set; }
        public int MediaCount { get; set; }
    }
}